﻿using System;

namespace WZLY
{
    class Program
    {
        static Random gwsl = new Random();
        static HaoY haoy = new HaoY();
        public static int gwsl1,JNHH=0;
        public static int hyjl=1,sl=1,jingyan=0,zh=0,mm=0;
        public static bool pbd = true;
        public static bool GJGH = true,sw=true;
        static void Main(string[] args)
        { 
            DLMB YSRXX=ZCZH();
            DL(YSRXX);
            while(true)
            { 
            int kzx =ChuangJianGuaiWu();
            for (int i = 0; i < 5; i++)
            {
                 for (int j = 0; j < gwsl1; j++)
                 {
                    while(HaoY.haoy[i].XueLiang > 0 && GuaiWu.guaiwu[j].XueLiang > 0)
                    {
                        WJGJ();
                        GWGJ();
                    }
                 }
            }
            if (HaoY.haoy[0].XueLiang > 0 || HaoY.haoy[1].XueLiang > 0 || HaoY.haoy[2].XueLiang > 0 || HaoY.haoy[3].XueLiang > 0 || HaoY.haoy[4].XueLiang > 0)
            {
                Console.WriteLine("玩家胜利");
                if (jingyan>=2000)
                {
                    YSRXX.DJ++;
                    jingyan = jingyan - 2000;
                }
                Console.WriteLine("输入1再来一局,输入2返回游戏大厅，输入3退出游戏");
                int ddd=Convert.ToInt32(Console.ReadLine());
                if (ddd == 1)
                {
                    ChuangJianKS(YSRXX);
                }
                else if (ddd==2)
                {
                    YXDT(YSRXX);
                }
                    else if (ddd == 3)
                    {
                        Environment.Exit(0);
                    }
                }
            else
            { bool youXue = false;
                for (int i = 0; i < kzx; i++)
                {
                    if (GuaiWu.guaiwu[i].XueLiang > 0)
                    {
                        youXue = true;
                        break;
                    }
                }
                if (youXue)
                {
                    Console.WriteLine("怪物胜利");
                    if (jingyan >= 2000)
                    {
                        DLMB dj = new DLMB();
                        dj.DJ++;
                        jingyan = jingyan - 2000;
                    }
                    Console.WriteLine("输入1再来一局,输入2返回游戏大厅，输入3退出游戏");
                    int ddd = Convert.ToInt32(Console.ReadLine());
                    if (ddd == 1)
                    {
                            ZuDui dsd = new ZuDui(YSRXX);
                    }
                    else if (ddd == 2)
                    {
                        YXDT(YSRXX);
                    }
                        else if (ddd == 3)
                        {
                            Environment.Exit(0);
                        }
                    }
            }
            }
            /*          for (int k = 0; k < gwsl1; k++)
                      {
                          Console.WriteLine("mz{0}x{1}",GuaiWu.guaiwu[k].WuKang, GuaiWu.guaiwu[k].XueLiang);
                      }*/
        }
        public static void GWGJ()
        {
            for (int i = 0; i < gwsl1; i++)
            {
                Random GJ = new Random();
                int GJ1 = GJ.Next(0, gwsl1);
                int KoX =  GuaiWu.guaiwu[i].WuGong- HaoY.haoy[GJ1].WuKang;
                if (KoX <= 0)
                {
                    KoX = 10;
                }
                jingyan += KoX;
                HaoY.haoy[i].XueLiang -= KoX;
                if (HaoY.haoy[GJ1].XueLiang > 0)
                {
                    Console.WriteLine("{0}怪物攻击了编号为{1}的玩家,造成了{2}的伤害,角色剩余血量为{3}", i, HaoY.haoy[GJ1].Bianhao, KoX, HaoY.haoy[GJ1].XueLiang);
                }
                else
                {
                    Console.WriteLine("{0}玩家死亡,怪物攻击落空", GJ1);
                }
            }
        }
        public static void huodzb(int j,int i)
        {
           
            
                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei(0, (ZhuangBei.EnumZBLeiXing1)8, (ZhuangBei.EnumZBLeiXing2)8, (ZhuangBei.EnumZBLeiXing3)8, (ZhuangBei.EnumZBLeiXing4)8);

                if (Player._wanJiaZhuangBei[j] != null)
                {
                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                }
                else
                {
                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                    Player._wanJiaZhuangBei[0] = yongHuXuanDeZhuangBei;
                }
        }
        public static void WJGJ()
        {
            if (GJGH)
            {
                if (JNHH == 2)
                {
                    for (int i = 0; i < 5; i++)
                    {
                        for (int j = 0; j < gwsl1; j++)
                        {
                            int KoX = HaoY.haoy[i].WuGong - GuaiWu.guaiwu[j].WuKang;
                            if (KoX <= 0)
                            {
                                KoX = 10;
                            }
                            jingyan += KoX;
                            GuaiWu.guaiwu[j].XueLiang -= KoX;
                            if (GuaiWu.guaiwu[j].XueLiang > 0)
                            {
                                Console.WriteLine("编号为{0}的玩家使用技能攻击了{1}怪物,造成了{2}的伤害,怪物剩余血量为{3}", HaoY.haoy[i].Bianhao, j, KoX, GuaiWu.guaiwu[j].XueLiang);
                            }
                            else if(GuaiWu.guaiwu[j].XueLiang < 0)
                            {
                                if (GuaiWu.guaiwu[j].siw)
                                {
                                    GuaiWu.guaiwu[j].siw = false;
                                    Random zb = new Random();
                                    Random zb3 = new Random();
                                    int zb2 = zb3.Next(1, 6);
                                    int zb1 = zb.Next(1, 101);
                                    if (zb1 > 0 && zb1 <= 85)
                                    {
                                        switch (zb2)
                                        {
                                            case 1:
                                                Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1}输入1装备,其他任何数字键为放弃", j, Player._wanJiaZhuangBei[0]);
                                                if (1 == Convert.ToInt32(Console.ReadLine()))
                                                {
                                                huodzb(0,i);
                                                }
                                                break;
                                            case 2:
                                                Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", j, Player._wanJiaZhuangBei[1]); 
                                                if (1 == Convert.ToInt32(Console.ReadLine()))
                                                {
                                                    huodzb(1, i);
                                                }
                                                break;

                                            case 3:
                                                Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", j, Player._wanJiaZhuangBei[2]);
                                                if (1 == Convert.ToInt32(Console.ReadLine()))
                                                {
                                                    huodzb(2, i);
                                                }
                                                break;
                                            case 4:
                                                Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", j, Player._wanJiaZhuangBei[3]);
                                                if (1 == Convert.ToInt32(Console.ReadLine()))
                                                {
                                                    huodzb(3, i);
                                                }
                                                break;
                                            case 5:
                                                Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", j, Player._wanJiaZhuangBei[4]);
                                                if (1 == Convert.ToInt32(Console.ReadLine()))
                                                {
                                                    huodzb(4, i);
                                                }
                                                break;
                                            default:
                                                break;
                                        }


                                    }
                                }
                            }
                        }
                    }
                    JNHH = 0;
                }
                else
                {
                    for(int i = 0; i < 5; i++) 
                    {
                        Random GJ = new Random();
                        int GJ1 = GJ.Next(0, gwsl1);
                        int KoX = HaoY.haoy[i].WuGong - GuaiWu.guaiwu[GJ1].WuKang;
                        if (KoX <= 0)
                        {
                            KoX = 10;
                        }
                        jingyan += KoX;
                        GuaiWu.guaiwu[GJ1].XueLiang -= KoX;
                        if (GuaiWu.guaiwu[GJ1].XueLiang > 0)
                        {
                            Console.WriteLine("编号为{0}的玩家攻击了{1}怪物,造成了{2}的伤害,怪物剩余血量为{3}", HaoY.haoy[i].Bianhao, GJ1, KoX, GuaiWu.guaiwu[GJ1].XueLiang);
                        }
                        else if(GuaiWu.guaiwu[GJ1].XueLiang<0)
                        {
                            if (GuaiWu.guaiwu[GJ1].siw)
                            {
                                GuaiWu.guaiwu[GJ1].siw = false;
                                Random zb = new Random();
                                Random zb3 = new Random();
                                int zb2 = zb3.Next(1,6);
                                int zb1 = zb.Next(1,101);
                                if (zb1 > 0 && zb1 <= 85)
                                {
                                    switch (zb2)
                                    {
                                        case 1:
                                            Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[0]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                huodzb(0, i);
                                            }
                                            break;
                                        case 2:
                                            Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[1]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                huodzb(1, i);
                                            }
                                            break;
     
                                        case 3:
                                            Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[2]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                huodzb(2, i);
                                            }
                                            break;
                                        case 4:
                                            Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[3]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                huodzb(3, i);
                                            }
                                            break;   
                                        case 5:
                                            Console.WriteLine("{0}怪物死亡,获得白色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[4]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                huodzb(4, i);
                                            }
                                            break;
                                        default:
                                            break;
                                    }
                                   
                                    
                                }
                                else if(zb1>85&&zb1<85)
                                {
                                    switch (zb2)
                                    {
                                        case 1:
                                            Console.WriteLine("{0}怪物死亡,获得蓝色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[0]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei(0, (ZhuangBei.EnumZBLeiXing1)8, (ZhuangBei.EnumZBLeiXing2)8, (ZhuangBei.EnumZBLeiXing3)8, (ZhuangBei.EnumZBLeiXing4)8);

                                                if (Player._wanJiaZhuangBei[0] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[0] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;
                                        case 2:
                                            Console.WriteLine("{0}怪物死亡,获得蓝色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[1]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei((ZhuangBei.EnumZBLeiXing)8, 0, (ZhuangBei.EnumZBLeiXing2)8, (ZhuangBei.EnumZBLeiXing3)8, (ZhuangBei.EnumZBLeiXing4)8);

                                                if (Player._wanJiaZhuangBei[1] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[1] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;

                                        case 3:
                                            Console.WriteLine("{0}怪物死亡,获得蓝色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[2]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei((ZhuangBei.EnumZBLeiXing)8, (ZhuangBei.EnumZBLeiXing1)8, 0, (ZhuangBei.EnumZBLeiXing3)8, (ZhuangBei.EnumZBLeiXing4)8);

                                                if (Player._wanJiaZhuangBei[2] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[2] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;
                                        case 4:
                                            Console.WriteLine("{0}怪物死亡,获得蓝色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[3]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei((ZhuangBei.EnumZBLeiXing)8, (ZhuangBei.EnumZBLeiXing1)8, (ZhuangBei.EnumZBLeiXing2)8, 0, (ZhuangBei.EnumZBLeiXing4)8);

                                                if (Player._wanJiaZhuangBei[3] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[3] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;
                                        case 5:
                                            Console.WriteLine("{0}怪物死亡,获得蓝色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[4]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei((ZhuangBei.EnumZBLeiXing)8, (ZhuangBei.EnumZBLeiXing1)8, (ZhuangBei.EnumZBLeiXing2)8, (ZhuangBei.EnumZBLeiXing3)8, 0);

                                                if (Player._wanJiaZhuangBei[4] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[4] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;
                                        default:
                                            break;
                                    }

                                }
                                else if(zb1>95&&zb1<=100)
                                    switch (zb2)
                                    {
                                        case 1:
                                            Console.WriteLine("{0}怪物死亡,获得红色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[0]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei(0, (ZhuangBei.EnumZBLeiXing1)8, (ZhuangBei.EnumZBLeiXing2)8, (ZhuangBei.EnumZBLeiXing3)8, (ZhuangBei.EnumZBLeiXing4)8);

                                                if (Player._wanJiaZhuangBei[0] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[0] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;
                                        case 2:
                                            Console.WriteLine("{0}怪物死亡,获得红色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[1]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei((ZhuangBei.EnumZBLeiXing)8, 0, (ZhuangBei.EnumZBLeiXing2)8, (ZhuangBei.EnumZBLeiXing3)8, (ZhuangBei.EnumZBLeiXing4)8);

                                                if (Player._wanJiaZhuangBei[1] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[1] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;

                                        case 3:
                                            Console.WriteLine("{0}怪物死亡,获得红色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[2]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei((ZhuangBei.EnumZBLeiXing)8, (ZhuangBei.EnumZBLeiXing1)8, 0, (ZhuangBei.EnumZBLeiXing3)8, (ZhuangBei.EnumZBLeiXing4)8);

                                                if (Player._wanJiaZhuangBei[2] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[2] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;
                                        case 4:
                                            Console.WriteLine("{0}怪物死亡,获得红色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[3]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei((ZhuangBei.EnumZBLeiXing)8, (ZhuangBei.EnumZBLeiXing1)8, (ZhuangBei.EnumZBLeiXing2)8, 0, (ZhuangBei.EnumZBLeiXing4)8);

                                                if (Player._wanJiaZhuangBei[3] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[3] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;
                                        case 5:
                                            Console.WriteLine("{0}怪物死亡,获得红色装备，原装备属性为:{1},输入1装备,其他任何数字键为放弃", GJ1, Player._wanJiaZhuangBei[4]);
                                            if (1 == Convert.ToInt32(Console.ReadLine()))
                                            {
                                                ZhuangBei yongHuXuanDeZhuangBei = new ZhuangBei((ZhuangBei.EnumZBLeiXing)8, (ZhuangBei.EnumZBLeiXing1)8, (ZhuangBei.EnumZBLeiXing2)8, (ZhuangBei.EnumZBLeiXing3)8, 0);

                                                if (Player._wanJiaZhuangBei[4] != null)
                                                {
                                                    HaoY.haoy[i].XueLiang -= yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong -= yongHuXuanDeZhuangBei.WuGong;
                                                    HaoY.haoy[i].FaGong -= yongHuXuanDeZhuangBei.FaGong;
                                                    HaoY.haoy[i].WuKang -= yongHuXuanDeZhuangBei.WuKang;
                                                    HaoY.haoy[i].FaKang -= yongHuXuanDeZhuangBei.FaKang;

                                                }
                                                else
                                                {
                                                    HaoY.haoy[i].XueLiang = yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].XueLiang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaGong += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].WuKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    HaoY.haoy[i].FaKang += yongHuXuanDeZhuangBei.XueLiang;
                                                    Player._wanJiaZhuangBei[4] = yongHuXuanDeZhuangBei;
                                                }
                                            }
                                            break;
                                        default:
                                           break;
                                    }
                            }
                        }
                    }
                    JNHH++;
                }
            }
        }
        public static int ChuangJianGuaiWu()
        {
            int k = 0;
             gwsl1 = gwsl.Next(1, 5);
            for (int i=0;i<gwsl1;i++)
            {
                k++;
                Random sj = new Random();
                int yongHuXuanDeGuaiWu = sj.Next(0, 3);
                GuaiWu.EnumGuaiWuLeiXing xuanDeLeiXing = (GuaiWu.EnumGuaiWuLeiXing)yongHuXuanDeGuaiWu;
                GuaiWu.guaiwu[i] = new GuaiWu(xuanDeLeiXing);
            }
            return k;
        }
        public static void ChuangJianKS(DLMB YSRXX)
        {
            HaoY.haoy[0] = new HaoY();
            HaoY.haoy[0].Bianhao =YSRXX.Bianhao;
            HaoY.haoy[0].DJ = YSRXX.DJ;
            HaoY.haoy[0].Name = YSRXX.Name;
            HaoY.haoy[0].XB1 = YSRXX.XB1;
            HaoY.haoy[0].XueLiang = YSRXX.XueLiang;
            HaoY.haoy[0].WuGong = YSRXX.WuGong;
            HaoY.haoy[0].WuKang = YSRXX.WuKang;
            HaoY.haoy[0].FaGong = YSRXX.FaGong;
            HaoY.haoy[0].FaKang = YSRXX.FaKang;
            int i = 0;
            for (; sl <5; sl++)
            {
                HaoY haoy2 = new HaoY(ZuDui.zudui1[i]);
                if (haoy2.Bianhao == 0)
                {
                    ZuDui.zudui1[i] = (ZuDui.QBHaoy)6;
                }
                i++;
            }
            for (int j = 0; j < 5; j++)
            {
                HaoY.haoy[j + 1] = new HaoY(ZuDui.zudui1[j]);
            }
        }
        public static DLMB ZCZH()
        {
            string Zh, Mm, Zcsrmm, Name, Qm;
            Console.WriteLine("账号注册");
            Console.WriteLine("输入账号");
            Zh = Console.ReadLine();
            Console.WriteLine("输入密码");
            Mm = Console.ReadLine();
            Console.WriteLine("再次输入密码");
            Zcsrmm = Console.ReadLine();
            if (Mm != Zcsrmm)
            {
                Console.WriteLine("密码输入不一致");
                ZCZH();
            }
            else
            {
                Console.WriteLine("输入昵称");
                Name = Console.ReadLine();
                Console.WriteLine("输入1性别为boy，输入2性别为girl");
                int Xb1 = int.Parse(Console.ReadLine());
                DLMB.XB Xb2 = (DLMB.XB)Xb1;
                Console.WriteLine("输入个性签名");
                Qm = Console.ReadLine();
                DLMB xsdds=new DLMB(Zh, Mm, Zcsrmm, Name,Xb2,Qm);
                Console.WriteLine("注册成功,返回登陆界面");
                DLMB.mm1[mm++] = Mm;
                DLMB.zh1[zh++] = Zh;
                return xsdds;
            }
            return null;
        }
        public static void DL(DLMB YSRXX)
        {

            Console.WriteLine("输入1进入输入账号密码界面,输入2为修改密码界面,输入3退出游戏,输入4重新注册");
            int pd =Convert.ToInt32(Console.ReadLine());
            if (pd == 1)
            {
                DL1(YSRXX);
            }
            else if (pd == 2)
            {
                //  DLMB Pdxx = new DLMB();
                Console.WriteLine("输入账号");
                string zhpd = Console.ReadLine();
                if (zhpd != YSRXX.ZH)
                {
                    Console.WriteLine("账号输入错误");
                    DL(YSRXX);
                }
                else
                {
                    Console.WriteLine("输入新的密码");
                    YSRXX.MM = Console.ReadLine();
                    Console.WriteLine("返回登陆面板");
                    DL(YSRXX);
                }
            }
            else if (pd == 3)
            {
                Environment.Exit(0);
            }
            else if (pd == 4)
            {
                    ZCZH();
            }
        }
        public static void YXDT(DLMB YSRXX)
        {
            Console.WriteLine("输入1切换账号，输入2进入好友系统,输入3进入消息系统");
            int pd1 = Convert.ToInt32(Console.ReadLine());
            if (pd1 == 1)
            {
                Console.WriteLine("返回登陆界面");
                DL(YSRXX);
            }
            else if (pd1 == 2)
            {
                HYXT(YSRXX);
            }
            else if (pd1 == 3)
            {
                XXXT1(YSRXX); 
            }
        }
        public static void HYXT(DLMB YSRXX)
        {
            Console.WriteLine("输入1返回游戏大厅,输入2查找玩家,输入3好友列表");
            int pd2= Convert.ToInt32(Console.ReadLine());
            if (pd2 == 1)
            {
                YXDT(YSRXX);
            }
            else if (pd2 == 2)
            {
                Console.WriteLine("输入1返回好友系统,输入2查找玩家");
                int pd3 = Convert.ToInt32(Console.ReadLine());
                if (pd3 == 1)
                {
                    HYXT(YSRXX);
                }
                else if (pd3 == 2)
                {
                    CZ(YSRXX);
                }
            }
            else if (pd2 == 3)
            {
                Console.WriteLine("输入1好友列表,输入2选择好友编号");
                int pd3 = Convert.ToInt32(Console.ReadLine());
                if(pd3==1)
                { 
                for (int i = 0; i < HaoY.xxcc.Length - 1; i++) 
                {
                    HaoY haoy2 = new HaoY(HaoY.xxcc[i]);
                        if (haoy2.Bianhao != 0)
                        {
                            Console.WriteLine("编号:{0}\n昵称:{1}\n签名:{2}\n性别:{3}\n等级:{4}\n", haoy2.Bianhao, haoy2.Name, haoy2.QM, haoy2.XB1, haoy2.DJ);
                        }
                }
                    HYXT(YSRXX);
                }
                if (pd3 == 2)
                {
                    Console.WriteLine("输入1发送私聊,输入2邀请组队,输入3删除好友,输入4返回");
                    int pd5 = Convert.ToInt32(Console.ReadLine());
                    if (pd5 == 3)
                    {
                        Console.WriteLine("输入要删除好友的编号");
                        int pd4 = Convert.ToInt32(Console.ReadLine());
                        for (int j = 1; j < HaoY.xxcc.Length - 1; j++)
                        {
                            HaoY haoy2 = new HaoY(HaoY.xxcc[j]);
                            if (pd4 == haoy2.Bianhao)
                            {
                                HaoY.xxcc[j] = 0;
                            }
                        }
                        YXDT(YSRXX);
                    }
                    else if (pd5 == 1)
                    {
                        Console.WriteLine("发送私聊");
                        string fssl = Console.ReadLine();
                        XXXT xx =new XXXT(fssl);
                        HYXT(YSRXX);
                    }
                    else if (pd5 == 2)
                    {

                        YQHY(YSRXX);
                    }
                    else if (pd5 == 4)
                    {
                        HYXT(YSRXX);
                    }
                }
            }
        }
        public static void CZ(DLMB YSRXX)
        {
            Console.WriteLine("输入玩家的编号进行查找");
            int bhcz = Convert.ToInt32(Console.ReadLine());
            HaoY.QBHaoy HYBH = (HaoY.QBHaoy)bhcz;
            HaoY haoy1 = new HaoY(HYBH);
            if (haoy1.pdyhmy)
            {
                haoy1.pdyhmy = false;
                Console.WriteLine("输入1查看资料面板,输入2添加好友,输入3返回");
                int pd4 = Convert.ToInt32(Console.ReadLine());
                if (pd4 == 1)
                {
                    Console.WriteLine("编号:{0}\n昵称:{1}\n签名:{2}\n性别:{3}\n等级:{4}\n", haoy1.Bianhao, haoy1.Name, haoy1.QM, haoy1.XB1, haoy1.DJ);
                    HYXT(YSRXX);
                }
                else if (pd4 == 2)
                {
                    HaoY.xxcc[hyjl] = (HaoY.QBHaoy)bhcz;
                    hyjl = hyjl + 1;
                    HYXT(YSRXX);
                }
                else if (pd4 == 3)
                {
                    HYXT(YSRXX);
                }
            }
            else
            {
                Console.WriteLine("没有该玩家,请重新查找");
                CZ(YSRXX);
            }
        }
        public static void YQHY(DLMB YSRXX)
        {
            Console.WriteLine("输入要邀请组队好友的编号");
            int pd6 = Convert.ToInt32(Console.ReadLine());
            for (int j = 1; j < HaoY.xxcc.Length - 1; j++)
            {
                HaoY haoy2 = new HaoY(HaoY.xxcc[j]);
                if (pd6 == haoy2.Bianhao)
                {
                   // sl++;
                    ZuDui.zudui1[j] = HaoY.xxcc[j];
                    Console.WriteLine("编号:{0}\n昵称:{1}\n签名:{2}\n性别:{3}\n等级:{4}\n", haoy2.Bianhao, haoy2.Name, haoy2.QM, haoy2.XB1, haoy2.DJ);
                    ZuDui zu = new ZuDui(YSRXX);
                    pbd = false;
                }
            }
            if (pbd)
            {
                Console.WriteLine("没有该玩家好友,请输入1重新邀请或输入2开始游戏");
                int pd7 = Convert.ToInt32(Console.ReadLine());
                if (pd7 == 1)
                {
                    YQHY(YSRXX);
                }else if(pd7==2)
                {
                    Console.WriteLine("开始游戏");
                     new ZuDui(YSRXX);
                }
            }
        }
        public static void DL1(DLMB YSRXX)
        {
            Console.WriteLine("输入账号");
            string DlZH = Console.ReadLine();
         //   DLMB.zh1[zh++] = DlZH;
            Console.WriteLine("输入密码");
            string DlMM = Console.ReadLine();
            //  DLMB.mm1[mm++] = DlMM;
            for (int i = 0; i < DLMB.zh1.Length; i++)
            {
                if (DlZH == DLMB.zh1[i] )
                {
                    if (DLMB.mm1[i] == DlMM)
                    {
                        Console.WriteLine("登陆成功,到游戏大厅");
                        YXDT(YSRXX);
                    } 
                    else
                    {
                    Console.WriteLine("账号不对，或者密码错误");
                    DL1(YSRXX);
                    }
                }
                
          
            }
        }
        public static void XXXT1(DLMB YSRXX)
        {
            Console.WriteLine("输入1未读消息列表，输入2返回");
            int pd6= Convert.ToInt32(Console.ReadLine());
            if (pd6 == 1)
            {
                if (XXXT.sl != 1)
                {
                    for (int i = 1; i < XXXT.sl; i++)
                    {
                        Console.WriteLine("发送人:{0},消息内容{1}", YSRXX.Name, XXXT.wddxx[i]);
                    }
                }
                else { Console.WriteLine("没有消息"); }
                XXXT1(YSRXX);
            }
            else if (pd6 == 2)
            {
                YXDT(YSRXX);
            }
        }
    }
}
